package com.example.tacocloud.mapper;

import com.example.tacocloud.bean.Ingredient;
import com.example.tacocloud.bean.Order;
import com.example.tacocloud.bean.Taco;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

@Mapper
public interface TacoMapper {

    @Select("select id from Taco where name = #{name}")
    public long findTacoId(String name);

    @Insert("insert into Taco (name, createdAt) values (#{name}, #{createdAt})")
    public void saveTacoInfo(String name, Date createdAt);

    @Insert("insert into Taco_Ingredients (taco, ingredient) values (#{taco}, #{ingredient})")
    public void saveIngredientToTaco(long taco, String ingredient);
}
